{% extends 'admin/layout.njk' %}

{% block css %}
  <link href="/_admin/css/blog_list.css" rel="stylesheet">
{% endblock %}

{% block main %}
  <div id="blog-list">
    <table>
      <thead>
        <tr>
          <th>Title</th>
          <th>Category</th>
          <th>Release Date</th>
          <th>Operate</th>
        </tr>
      </thead>
      <tbody>
        {% for blog in data.blogs %}
          <tr>
            <td title="{{blog.title}}">{{blog.title}}</td>
            <td title="{{blog.category}}">{{blog.category}}</td>
            <td title="{{blog.releaseDate}}">{{blog.releaseDate}}</td>
            <td class="operate">
              <a href="{{blog.previewUrl}}" title="preview">
                <i class="fa fa-paper-plane"></i>
              </a>
              <a href="{{blog.modifyUrl}}" title="modify">
                <i class="fa fa-edit"></i>
              </a>
              <a href="{{blog.deleteUrl}}" class="delete-button">
                <i class="fa fa-trash-o"></i>
              </a>
            </td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
    {% if data.previousPage %}
      <a href="{{data.previousPage}}">preview</a>
    {% endif %}
    {% if data.nextPage %}
      <a href="{{data.nextPage}}">next</a>
    {% endif %}
  </div>
{% endblock %}